package ihm.actions;

import ihm.models.ATKmodel;
import ihm.views.main.catalog.FilterBar;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import systems.database.query.condition.Condition;

public class FilterReset implements ActionListener {

  private ATKmodel model;
  private Condition filterCondition = new Condition();
  private FilterBar filterBar;
  
  public FilterReset(FilterBar filterBar, ATKmodel model)
  {
    this.filterBar = filterBar;
    this.model = model;
  }
  public void actionPerformed(ActionEvent e) {
    this.filterCondition = model.buildItemSelectedCondition();
    this.model.getQuery().setWhereCondition(this.filterCondition);
    //On remet a jours tous les champs
    this.filterBar.reset();
    // TODO
    //this.model.fireQueryChanged();
  }
}
